﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class WorkTimeN_SumWorkTime_OverTime2Rest : System.Web.UI.Page
{
    private Srvtools.WebDataSet WMaster;

    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            InitializeComponent(true);

            Master.DataSource = WMaster;

            MasterPage_MasterPage master = (MasterPage_MasterPage)this.Page.Master;
            master.HelpHref = "";
            master.PageName = "员工调休天数合计";
            master.PicUrl = "";
            master.IntiBar();
        }
    }

    private void InitializeComponent(bool Action)
    {
        System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(WorkTimeN_SumWorkTime_OverTime2Rest));
        this.WMaster = new Srvtools.WebDataSet();
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).BeginInit();
        // 
        // WMaster
        // 
        this.WMaster.Active = Action;
        this.WMaster.AlwaysClose = false;
        this.WMaster.PacketRecords = 100;
        this.WMaster.Position = -1;
        this.WMaster.RemoteName = "SWorkTime.ViewWorkTime_OverTime2Rest2";
        this.WMaster.ServerModify = false;
        ((System.ComponentModel.ISupportInitialize)(this.WMaster)).EndInit();
    }

    protected void Search_Click(object sender, EventArgs e)
    {
        string strDep = Depart.SelectDepmanetId;
        if (strDep == "")
        {
            strDep = "";
        }
        else if (strDep == "0")
        {
            strDep = "";
        }
        else
        {
            strDep = "And Employees.DepartmentId like ('" + strDep + "%')";

        }


        string sname = SelUser.EmpName;
        if (sname != "")
        {
            sname = "And Employees.EmpName like ('%" + sname + "%')";

        }
        else
        {
            sname = "";
        }

        InitializeComponent(true);

        WMaster.SetWhere("1=1 " + strDep + sname);
        Master.DataSource = WMaster;
    }
}
